package com.study.concurrent.B_ThreadSynchronizedBasic.b_UseSynchronized;

/**
 * Created by 赵超 on 2017/3/21.
 * 模拟银行ATM取钱扣除账户金额
 */
public class Bank implements Runnable {
    private Account account;

    public Bank(Account account) {
        this.account = account;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            account.subtractAmount(1000);
        }
    }
}
